﻿<%@ Page Language="C#" MasterPageFile="~/grid.master" AutoEventWireup="true" CodeFile="MasterDetail.aspx.cs"
    Inherits="Common_MasterDetail" Title="Untitled Page" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.3" Namespace="DevExpress.Web.ASPxGridView"
    TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.3" Namespace="DevExpress.Web.ASPxEditors"
    TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v8.3" Namespace="DevExpress.Web.ASPxCallbackPanel"
    TagPrefix="dxcp" %>
<%@ Register Assembly="DevExpress.Web.v8.3" Namespace="DevExpress.Web.ASPxPanel"
    TagPrefix="dxp" %>

<%@ Register Src="../UseControl/PageCommon.ascx" TagName="PageCommon" TagPrefix="uc1" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.3.Export, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377C8E3B72B4073"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
    Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dxcp" %>
<%@ Register Assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dxp" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.3, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.3, Version=8.3.2.0, Culture=neutral, PublicKeyToken=5377c8e3b72b4073"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<asp:Content ID="Content2" ContentPlaceHolderID="C2" runat="Server">
    <script type="text/javascript" src="../Script/Common.js"></script>
    <dxcp:ASPxCallbackPanel ID="ajaxPanel" ClientInstanceName="ajaxPanel" LoadingPanelText="数据加载中…"
        OnCallback="ajaxPanel_Callback" runat="server" HideContentOnCallback="False">
        <PanelCollection>
<dxp:PanelContent runat="server"><DIV class="queryLine"></DIV><DIV class="buttonLine"><uc1:PageCommon runat="server" ID="commonPageCtrl" OnExport="btnExport_Click" IsDetailMode="True" GridClientName="InfoGrid"></uc1:PageCommon>
 </DIV><DIV class="infoGrid"><dxwgv:ASPxGridView runat="server" Width="100%" ID="InfoGrid" DataSourceID="dataSource" KeyFieldName="ID" AutoGenerateColumns="False" ClientInstanceName="InfoGrid" OnHtmlRowCreated="InfoGrid_HtmlRowCreated" OnInitNewRow="InfoGrid_InitNewRow" OnRowUpdating="InfoGrid_RowUpdating" OnRowInserting="InfoGrid_RowInserting" OnPreRender="InfoGrid_PreRender" OnRowValidating="InfoGrid_RowValidating" OnRowDeleting="InfoGrid_RowDeleting" OnCustomCallback="InfoGrid_CustomCallback">
<SettingsDetail ShowDetailRow="True"></SettingsDetail>

<Border BorderWidth="0px"></Border>

<Templates><DetailRow>
                                <uc1:PageCommon ID="commonDetailPageCtrl" runat="server"></uc1:PageCommon>
                                <br />
                                <br />
                                <dxwgv:ASPxGridView ID="DetailGrid" runat="server" DataSourceID="detailDataSource"
                                    KeyFieldName="ID" Width="100%" OnBeforePerformDataSelect="detailGrid_DataSelect"
                                    OnCustomCallback="detailGrid_CustomCallback" OnRowInserting="detailGrid_RowInserting"
                                    OnRowUpdating="detailGrid_RowUpdating" OnInitNewRow="detailGrid_InitNewRow"
                                    OnRowDeleting="detailGrid_RowDeleting" OnRowValidating="detailGrid_RowValidating">
                                    <Columns>
                                        <dxwgv:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0">
                                            <HeaderTemplate>
                                                <input title="[选择/取消选择]本页所有行" onclick="DetailGrid.SelectAllRowsOnPage(this.checked);"
                                                    style="vertical-align: middle;" id="chkPageSelectAll" type="checkbox" />
                                            </HeaderTemplate>
                                            <HeaderStyle HorizontalAlign="Center" />
                                        </dxwgv:GridViewCommandColumn>
                                        <dxwgv:GridViewDataColumn FieldName="ProductName" VisibleIndex="2">
                                        </dxwgv:GridViewDataColumn>
                                        <dxwgv:GridViewDataColumn FieldName="SalePrice" VisibleIndex="3">
                                        </dxwgv:GridViewDataColumn>
                                        <dxwgv:GridViewDataColumn FieldName="SaleNum" VisibleIndex="4">
                                        </dxwgv:GridViewDataColumn>
                                        <dxwgv:GridViewDataColumn FieldName="TotalPrice" VisibleIndex="5" EditFormSettings-Visible="False">
                                        </dxwgv:GridViewDataColumn>
                                        <dxwgv:GridViewCommandColumn Caption="操作" VisibleIndex="5">
                                            <EditButton Visible="True">
                                            </EditButton>
                                            <DeleteButton Visible="True">
                                            </DeleteButton>
                                        </dxwgv:GridViewCommandColumn>
                                    </Columns>
                                    <Settings ShowFooter="True" />
                                    <TotalSummary>
                                        <dxwgv:ASPxSummaryItem FieldName="TotalPrice" SummaryType="Sum" DisplayFormat="c" />
                                        <dxwgv:ASPxSummaryItem FieldName="SaleNum" SummaryType="Sum" />
                                    </TotalSummary>
             
                                    <SettingsDetail IsDetailGrid="true" ExportIndex="0" />
                                </dxwgv:ASPxGridView>
                            
</DetailRow>
</Templates>

<ClientSideEvents CustomizationWindowCloseUp="function(s, e) { UpdateCustomizationWindowValue(); }"></ClientSideEvents>
<Columns>
<dxwgv:GridViewCommandColumn VisibleIndex="0" ShowSelectCheckbox="True">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<HeaderTemplate>
                                    <input title="[选择/取消选择]本页所有行" onclick="InfoGrid.SelectAllRowsOnPage(this.checked);"
                                        style="vertical-align: middle;" id="chkPageSelectAll" type="checkbox" />
                                
</HeaderTemplate>
</dxwgv:GridViewCommandColumn>
<dxwgv:GridViewDataTextColumn VisibleIndex="1" FieldName="OrderCode"></dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn VisibleIndex="2" FieldName="OwnerName"></dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn VisibleIndex="3" FieldName="ContactPhone"></dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataDateColumn VisibleIndex="4" FieldName="OrderTime">
<PropertiesDateEdit AllowUserInput="False">
<ReadOnlyStyle BackColor="#E0E0E0"></ReadOnlyStyle>
</PropertiesDateEdit>
</dxwgv:GridViewDataDateColumn>
<dxwgv:GridViewCommandColumn VisibleIndex="5" Caption="操作">
<DeleteButton Visible="True"></DeleteButton>

<EditButton Visible="True"></EditButton>
</dxwgv:GridViewCommandColumn>
</Columns>
</dxwgv:ASPxGridView>
 </DIV></dxp:PanelContent>
</PanelCollection>
    </dxcp:ASPxCallbackPanel>
    <asp:ObjectDataSource ID="dataSource" runat="server" DataObjectTypeName="OT.Module.Model.Order_MDL"
        TypeName="OT.Module.BLL.Order_BLL" SelectMethod="Select" OnObjectCreating="ds_ObjectCreating">
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="detailDataSource" runat="server" DataObjectTypeName="OT.Module.Model.OrderDetail_MDL"
        OnObjectCreating="ds_DetailObjectCreating" SelectMethod="Select" TypeName="OT.Module.BLL.OrderDetail_BLL">
        <SelectParameters>
            <asp:SessionParameter Name="orderId" SessionField="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
